﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace DeviceSimulation
{
    class Program
    {
        static void Main(string[] args)
        {
            CClient.ReadDeviceID();
            if (CClient._deviceID.Length > 0)
            {
                CClient.GetCurrentComputerIP();
                CClient.LinkServer();

                Console.WriteLine("线程创建完成！");

                while (true)
                {
                    Thread.Sleep(500);
                    Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") 
                        + "当前线程数量：" + (CClient._threadMana.Count).ToString());

                    if (CClient._threadMana.Count == 0) break;
                }

                Console.WriteLine("程序线束，请按任意键退出程序。。。");
            }
            else
            {
                Console.WriteLine("设备数量为零，请按任意键退出程序。。。");
            }
            Console.ReadKey();
        }
    }
}
